﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class ScoreRanking : MonoBehaviour {
    public GameObject rankItem;
    private void Start()
    {
        List<string[]> list = DataBase.Instance.GetAllRow();
        for (int i = 0; i < list.Count; i++)
        {
            Instantiate(rankItem, transform).GetComponent<Text>().text
                = (i+1)+". "+"player:" + list[i][0] + "   score:" + list[i][1];
        }
    }
    public void GoBack()
    {
        SceneManager.LoadSceneAsync(0);
    }
}
